<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()
            + "://" + request.getServerName()
            + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="<%=basePath%>css/base.css">
    <link rel="stylesheet" href="<%=basePath%>css/style.css">
    <script src="<%=basePath%>js/jquery-1.11.1.min.js"></script>
    <!--字体样式-->
    <link rel="stylesheet" href="<%=basePath%>dianzan/iconfont/iconfont.css" type="text/css"/>
    <!--必要样式-->
    <link rel="stylesheet" href="<%=basePath%>dianzan/css/index.css" type="text/css"/>
    <link rel="stylesheet" href="<%=basePath%>dianzan/css/animate.css" type="text/css"/>
    <jsp:include page="foot1.jsp"/>
</head>

<body>

<div class="content">
    <div class="wrap">
        <div class="tsm-height"></div>
        <div class="det">
            <input hidden value="${searchOneSuccess.id}" id="wenzhangid">
            <div class="det-fl fl"><img src="<%=basePath%>upload/juti.jpg"></div>
            <div class="det-fr fl">
                <div class="det-r1">文章主题：${searchOneSuccess.fname}</div>
                <div class="det-r2">作者：${searchOneSuccess.userEntity.name}</div>
                <div class="det-r2">浏览量：${searchOneSuccess.more2}</div>
                <div class="det-r2">文章类型：${searchOneSuccess.type}</div>
                <div class="det-r2">发布时间：${searchOneSuccess.ftime}</div>
                <div class="det-r2"></div>
                <div class="det-r2"></div>
            </div>
        </div>
        <div class="det-a">
            <div class="det-title"><img src="<%=basePath%>images/det-c.jpg">${searchOneSuccess.fname}</div>
            <p>${searchOneSuccess.fmain}</p>
        </div>
        <%--点赞--%>
        <div class="opera" style="margin-left: 500px">
            <span id="btn" onclick="dianzan()">
                <i class="iconfont">&#xe602;</i> 点赞
            </span>
        </div>
        <div class="det-b">
            <%--<form action="<%=basePath%>shixun/liuyanAdd" method="post">--%>
            <div class="det-title"><img src="<%=basePath%>images/det-c.jpg">在线留言</div>
            <div class="det-b1">
                <textarea id="liuyan" name="liuyan" class="det-area"></textarea>
            </div>
            <div class="det-b3"><input onclick="fabiaoliuyan()" type="button" class="det-btn" value="发表"></div>
            <%--</form>--%>
        </div>

        <div class="skt">
            <div class="skt-title">
                <span class="skt-cut">最新评论</span>
                <%--<span class="skt-cut">默认评论</span><em>|</em><span>最新评论</span>--%>
            </div>
            <div class="skt-tab">
                <div class="skt-btm" >
                    <ul class="skt-ul" id="yibupinlun">
                        <c:forEach items="${requestScope.searchAllPinlun}" var="allPL">
                            <li>
                                <div class="skt-a1"><img src="<%=basePath%>upload/det-tx.jpg">
                                        ${allPL.userEntity.name}
                                </div>
                                <div class="skt-a2">${allPL.fmain}</div>
                                <span style="float: right">发表时间：${allPL.ftime}</span>
                            </li>
                        </c:forEach>
                    </ul>
                    <br><br>
                    <div class="skt-more" style="margin-left: 100px"></div>
                </div>

                <div class="skt-btm hide">
                    222
                </div>
            </div>
        </div>
    </div>
</div>


<jsp:include page="/foot/foot1.jsp"/>
<!--登录注册弹窗-->
<div class="mask"></div>
<div class="login">
    <div class="login-title">
        <div class="login-a">登录</div>
        <div class="login-b"></div>
        <div class="login-c close">x</div>
    </div>
    <div class="login-btm">
        <div class="login-d"><input type="text" class="login-text" placeholder="注册时填写的邮箱"></div>
        <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
        <div class="login-d"><input type="button" class="login-btn" placeholder="登录"></div>
        <div class="login-f">
            <a href="">忘记密码</a>
            <span>还没有焦点账号?><a href="javascript:;" class="reg-href">点击注册</a></span>
        </div>
    </div>
</div>

<div class="reg">
    <div class="login-title">
        <div class="login-a">注册</div>
        <div class="login-b"></div>
        <div class="login-c close">x</div>
    </div>
    <div class="login-btm">
        <div class="login-d"><input type="text" class="login-text" placeholder="邮箱/手机号"></div>
        <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
        <div class="login-d"><input type="button" class="login-btn" placeholder="注册"></div>
        <div class="login-f">
            <a href="">忘记密码</a>
        </div>
    </div>
</div>
<script>

    <%--点赞的传送--%>
    function dianzan() {
        alert("登陆后才能点赞");
        <%--$.getJSON("<%=basePath%>shixun/dianZanNumber", {dianZan: a}, function (result) {--%>
            <%--alert(result.code);--%>
        <%--})--%>
    }
    //    发表评论
    function fabiaoliuyan() {
        alert("登录后才能发表文章");
//        var $wenzhangId = $("#wenzhangid").val();
//        var $liuyan = $("#liuyan").val();
        <%--$.getJSON("<%=basePath%>shixun/liuyanAdd", {wzId: $wenzhangId, lyMain: $liuyan}, function (result) {--%>
            <%--$("#yibupinlun").html("");--%>
            <%--for (var i = 0; i < result.length; i++) {--%>
                <%--$("#yibupinlun").append(--%>
                        <%--"<li>" +--%>
                        <%--"<div class='skt-a1'>" + "<img src='/upload/det-tx.jpg'>" +--%>
                        <%--result[i].UserEntity.name +--%>
                        <%--"<div class='menu'><a href=''>" +--%>
                        <%--"</a></div></div>"+--%>
                        <%--"<div class='skt-a2'>" + result[i].fmain + "</div>" +--%>
                        <%--"<span style='float: right'>" + "发表时间：" + result[i].ftime + "</span>" +--%>
                        <%--"</li>"--%>
                <%--)--%>
            <%--}--%>

        <%--})--%>
    }
</script>

<%--点赞--%>
<%--<script src="js/jquery.min.js" type="text/javascript"></script>--%>
<script type="text/javascript">
    (function ($) {
        $.extend({
            tipsBox: function (options) {
                options = $.extend({
                    obj: null,  //jq对象，要在那个html标签上显示
                    str: "+1",  //字符串，要显示的内容;也可以传一段html，如: "<b style='font-family:Microsoft YaHei;'>+1</b>"
                    startSize: "12px",  //动画开始的文字大小
                    endSize: "30px",    //动画结束的文字大小
                    interval: 600,  //动画时间间隔
                    color: "red",    //文字颜色
                    callback: function () {
                    }    //回调函数
                }, options);
                $("body").append("<span class='num'>" + options.str + "</span>");
                var box = $(".num");
                var left = options.obj.offset().left + options.obj.width() / 2;
                var top = options.obj.offset().top - options.obj.height();
                box.css({
                    "position": "absolute",
                    "left": left + "px",
                    "top": top + "px",
                    "z-index": 9999,
                    "font-size": options.startSize,
                    "line-height": options.endSize,
                    "color": options.color
                });
                box.animate({
                    "font-size": options.endSize,
                    "opacity": "0",
                    "top": top - parseInt(options.endSize) + "px"
                }, options.interval, function () {
                    box.remove();
                    options.callback();
                });
            }
        });
    })(jQuery);

    function niceIn(prop) {
        prop.find('i').addClass('niceIn');
        setTimeout(function () {
            prop.find('i').removeClass('niceIn');
        }, 1000);
    }
    $(function () {
        $("#btn").click(function () {
            $.tipsBox({
                obj: $(this),
                str: "+1",
                callback: function () {
                }
            });
            niceIn($(this));
        });
    });
</script>


<%--模板自带--%>
<script src="<%=basePath%>js/Action.js"></script>
<script>
    $(".skt-title span").click(function () {
        $(this).addClass("skt-cut").siblings().removeClass("skt-cut"),
                $(".skt-tab .skt-btm").hide().eq($(".skt-title span").index(this)).show()
    })
</script>
</body>
</html>
